package com.kandinfo.base.admin.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.kandinfo.base.common.util.web.WebUtil;

@Controller
public class HomeController {

    @RequestMapping(value = "/home", method = RequestMethod.GET)
    public String home(Model model) {
        if ("MOBILE".equals(WebUtil.checkDeviceType())) {
            return "/weixin/home";
        } else {
            return "/home";
        }
    }

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String home() {
        if ("MOBILE".equals(WebUtil.checkDeviceType())) {
            return "/weixin/home";
        } else {
            return "/home";
        }
    }
}
